<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #d1 {
        width: 1000px;
        height: 100px;
        background-color: rgb(32, 218, 172);
        /* 设置固定定位 会脱离文档流 */
        position: fixed;
        /* 让元素贴着窗口最上方 */
        top: 0;
      }
      body {
        /* 让body里面的内容往下移动100像素 */
        padding-top: 100px;
      }
      #d2 {
        width: 50px;
        height: 200px;
        background-color: blue;
        position: fixed;
        right: 30px;
        bottom: 50px;
      }
    </style>
  </head>
  <body>
    <div id="d1"></div>
    <div id="d2"></div>
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
    <img src="../2.webp" alt="" />
  </body>
</html>
